# 导包
import pymysql

# 连数据库
conn = pymysql.connect(host='192.168.126.133', port=3306, user='root', password='123456', database='litemall', charset='utf8')

# 创建游标
cursor = conn.cursor()

# 执行SQL语句,错误事务要进行回滚
try:
    for i in range(1,10000):
        cursor.execute(f'''INSERT INTO litemall.litemall_user (id, username, password, gender, birthday, last_login_time, last_login_ip, user_level, nickname, mobile, avatar, weixin_openid, session_key, status, add_time, update_time, deleted) VALUES (47+{i}, 'test{i}', '$2a$10$lTu9qi0hr19OC800Db.eludFr0AXuJUSrMHi/iPYhKRlPFeqJxlye', 1, null, '2025-07-25 10:47:56', '192.168.126.1', 0, 'test{i}', '', '', '', '', 0, '2019-04-20 22:17:43', '2025-07-25 10:47:56', 0);''')
        conn.commit()
except Exception as e:
    print(e)
    conn.rollback()

# 释放游标
cursor.close()
# 释放连接
conn.close()


